home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / self / contrib.lha / contrib / 491 / navel / lwView.self < prev    next >
Encoding:
Text File  |  1993-07-18  |  2.1 KB  |  89 lines

  1. "lwView.self,v 1.3 1993/07/18 20:24:08 richards Exp "
  2. " light weight views - X widgets that don't have corresponding X structure "
  3.  
  4. " A lwview must minimally have a superView, a manager, and a window "
  5. " A lwview may be part of a compound view, but currently may not be "
  6. " compound view. "
  7.  
  8. traits views _AddSlotsIfAbsent: (| ^ lwView = () |)
  9. traits views lwView _Define: (|
  10.     parent*** = traits abstractView.
  11.     identity** = mixins identity.
  12.  
  13.     window  = ( heavySuperView window ).
  14.     manager = ( heavySuperView manager ). 
  15.     ^ isRealised = (heavySuperView isNil ifTrue: [ ^false. ] False: [ ^heavySuperView isLive ]).
  16.     ^ isReal = (isRealised).
  17.     ^ isHeavy = (false).
  18.     ^ isLight = (true).
  19.     
  20.     ^ setSuperView: sv = (
  21.     superView: sv.
  22.     sv isNil ifFalse: [
  23.         heavySuperView: sv heavySuperView.
  24.     ].
  25.     ).
  26.  
  27.     realising* = (|
  28.     realise = (42).
  29.     unrealise = (42).
  30.     basicUnrealise = (42).
  31.     |).
  32.  
  33.     mapping* = (|
  34.     map = (42).
  35.     unmap = (42).
  36.     |).
  37.  
  38.     printing* = (|
  39.     printString = ('viewLite: ',iName).
  40.     |).
  41.  
  42.     drawing* = (|
  43.     drawAt: p String: s = (
  44.         heavySuperView drawAt: p String: s
  45.     ).
  46.     drawAt: p String: s InFont: fontStruct = (
  47.         heavySuperView drawAt: p String: s InFont: fontStruct
  48.     ).
  49.     drawFrom: o To: c Width: w = (
  50.         heavySuperView drawFrom: o To: c Width: w
  51.     ).
  52.     drawFrom: o To: c = (
  53.         heavySuperVIew drawFrom: o To: c
  54.     ).
  55.     drawLine: r = (
  56.         heavySuperView drawLine: r
  57.     ).
  58.     drawFrom: o For: c = (
  59.         heavySuperView drawFrom: o For: c
  60.     ).
  61.     drawXorRectangleFrom: o To: c = (
  62.         heavySuperView drawXorRectangleFrom: o To: c
  63.     ).
  64.     drawXorRectangle: rect = (
  65.         heavySuperView drawXorRectangle: rect
  66.     ).
  67.     |).
  68.  
  69.     fonts* = (|
  70.     drawAt: p String: s InFontNamed: fname = (
  71.         heavySuperView drawAt: p String: s InFontNamed: fname
  72.     ).
  73.     drawInFixedFontAt: p String: s = (
  74.         heavySuperView drawInFixedFontAt: p String: s
  75.     ).
  76.     openFontNamed: fname = (
  77.         heavySuperView openFontNamed: fname
  78.     ).
  79.     |).
  80. |)
  81.  
  82. prototypes views _AddSlotsIfAbsent: (| ^lwView = () |)
  83. prototypes views lwView _Define: prototypes views abstractView
  84. prototypes views lwView _AddSlots: (|
  85.     parent* = traits lwView.
  86.     ^_ heavySuperView <- nil.
  87. |)
  88.  
  89.